home *** CD-ROM | disk | FTP | other *** search
- --------------------------------------
-
- sampleclass V0.10
-
- A BOOPSI class programming example.
-
- --------------------------------------
-
-
- Description:
- ------------
-
- This is an example BOOPSI class project for StormC. Of course it works on other
- compilers too, but it will require some tweaking.
- I have used this as a basis for the classes in the ClassFree archive.
-
- This document contains some notes and hints that might be usefull when
- programming new BOOPSI classes.
-
- Descriptions of the individual files are in the document files.doc.
-
-
- Programming notes:
- ------------------
-
- First of all. Some of the classes in the OS should be considered in BETA state,
- because they seem to be missing some features that are documentet. Some classes
- are not documentet very good and you have to do some experimenting to find out
- some of their quirks.
-
- The build-in button class (and frbuttonclass).
-
- The class leaves some to be desired. You have to do a lot of things yourself,
- for instance if you want to do a standard text gadget then you have to supply an
- image object as well as the text (frameiclass) because it is the image that
- handles the mousehit routines.
- On the Amiga Developer CD there is a replacement buttonclass that corrects most
- of the problems that occure when using the build in class. But this one has
- problems too. It doesn't support (AFAICS) ICA_TARGET and ICA_MAP (which, by the
- way, for some reason is defined in capitalized letters and and not as it is
- written in all documentation ICA_Target and ICA_Map) which are essential if you
- want to use it as a basis for group gadgets.
-
- The groupgclass.
-
- Very poorly documentet if you ask me. I didn't even want to try to mess with
- LAYOUT stuff, I don't think it works, althought it might..
- The main thing that fooled me a lot about this class is that when you hand the
- GA_Left, and GA_Top attributes to it, then all gadgets you add as members must be
- placed relative to this position, so if you want a button to appear right where
- you positioned the groupgadget then the botton must have the GA_Left and GA_Top
- set to 0.
- When you change a gadgets attributes after it has been added to the membership
- the you should use either use SetGadgetAttrs() or supply the GadgetInfo to
- DoMethod in some way. Else the gadget rendering will fail (possibly intuition
- will hang but I'm not quite sure). I had a lot of problems with this myself.
- If you are making a sub class of groupgclass:
- If you have several gadgets communicating with ICA_TARGET, then be sure that
- you DON'T call the SuperClass (ie. groupgclass) before you are about to process
- the incoming data. You can target your own groupgclass object with ICA_TARGET
- for example with buttons. This way you will get the OM_UPDATE method issued and
- the GA_ID of the gadget that was hit will be in the in the attributes list.
- Now. If you call DoSupermethod the groupgclass will go and send a
- IDCMP_GADGETUP message with your gadgets GA_ID to the applictation that is using
- your subclass object. Since the application is likely to have its own gadget
- with the GA_ID that you are using it will think that the user has hit one of the
- aplications gadgets and unwanted effects will occure.
-
-
- General hints:
- --------------
-
- Sometimes the Superclass must be overriden entirely. In the above example with
- OM_UPDATE in groupgclass you should not call the SuperMethod at all, because it
- will cause unwanted results.
-
- Be very carefull to jump out of the dispatcher switch with break or return. You
- will be punished for running out of bounds..
-
-
- History:
- --------
-
- V0.01
-
- First test release.
-
- V0.10
-
- Put all OpenLibrary and CloseLibrary calls in
- seperate routines.
- Added debugging routines.
-
- V0.12
-
- I should have known better than to use
- dos.library functions from within a library..
- -replaced the debugging routines :)
-
- V0.13
-
- Removed some useless code left over from the class that
- this sampleclass was based on.
-